package com.welab.helloworld.controller;

import com.welab.helloworld.service.HelloWorldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloWorldController {
    @Autowired
    private HelloWorldService helloWorldService;
    @PostMapping("/startProcess")
    public Object startProcess() {
        return helloWorldService.startProcess();
    }


    @PostMapping("/getTasks")
    public Object getTasks() {
        return helloWorldService.getTasks();
    }

    @PostMapping("/claimTask")
    public Object claimTask() {
        return helloWorldService.claim();
    }

    @PostMapping("/completeTask")
    public Object completeTask(String assignee) {
        return helloWorldService.complete(assignee);
    }
}
